export const sleep = (time) => new Promise(resolve => setTimeout(resolve, time))

export async function mockUpload (file) {
    await sleep(2000)
    return {
        url: URL.createObjectURL(file),
        file: file,
    }
}

export async function mockUploadFail () {
    await sleep(1000)
    throw new Error('Fail to upload')
}